<?php

use Illuminate\Database\Seeder;
use App\User;

class UserSeed extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //配合UserFactory工厂执行数据填充
        //factory(执行工厂，填充数量)
        factory(User::class,10)->create();
        //指定ID变更为管理员
        $user = User::find(1);
        $user['username'] = 'admin';
        $user['email']='admin@qq.com';
        $user['status']=1;
        $user['admin_id']=1;
        $user->save();
    }
}
